import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { DjjErrorVO, DjjErrorForm, DjjErrorQuery } from '@/api/system/djjError/types';

/**
 * 查询纠错管理列表
 * @param query
 * @returns {*}
 */

export const listDjjError = (query?: DjjErrorQuery): AxiosPromise<DjjErrorVO[]> => {
  return request({
    url: '/system/djjError/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询纠错管理详细
 * @param id
 */
export const getDjjError = (id: string | number): AxiosPromise<DjjErrorVO> => {
  return request({
    url: '/system/djjError/' + id,
    method: 'get'
  });
};

/**
 * 新增纠错管理
 * @param data
 */
export const addDjjError = (data: DjjErrorForm) => {
  return request({
    url: '/system/djjError',
    method: 'post',
    data: data
  });
};

/**
 * 修改纠错管理
 * @param data
 */
export const updateDjjError = (data: DjjErrorForm) => {
  return request({
    url: '/system/djjError',
    method: 'put',
    data: data
  });
};

/**
 * 删除纠错管理
 * @param id
 */
export const delDjjError = (id: string | number | Array<string | number>) => {
  return request({
    url: '/system/djjError/' + id,
    method: 'delete'
  });
};
